﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using ZDSoft.TES.Entity.SystemEntity;

namespace ZDSoft.TES.Entity.FunctionEntity
{
    [ActiveRecord("Evaluate")]
    public class Evaluate : EntityBase<Evaluate>
    {
        /// <summary>
        /// 总分
        /// </summary>
        [Property]
        public int FullMarks { get; set; }

        /// <summary>
        /// 学期
        /// </summary>
        [Property]
        public Term Term { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary
        [Property]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [Property]
        public DateTime EndTime { get; set; }

        [HasAndBelongsToMany(typeof(Organization), Table = "EvaluateOrganization", ColumnKey = "EvaluateID", ColumnRef = "OrganizationID", Inverse = true, Lazy = true)]
        public IList<Organization> Organizations { get; set; }

        [HasAndBelongsToMany(typeof(Rule), Table = "EvaluateRule", ColumnKey = "EvaluateID", ColumnRef = "RuleID", Inverse = true, Lazy = true)]
        public IList<Rule> Rules { get; set; }

        [HasMany(typeof(Score), ColumnKey = "EvaluateID", Inverse = true, Lazy = true)]
        public IList<Score> Scores { get; set; }
    }
}
